

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
  "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml">
  <head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    
    <title>8.12. UserDict — Class wrapper for dictionary objects &mdash; Python v2.7.8 documentation</title>
    <link rel="stylesheet" href="../_static/default.css" type="text/css" />
    <link rel="stylesheet" href="../_static/pygments.css" type="text/css" />
    <script type="text/javascript">
      var DOCUMENTATION_OPTIONS = {
        URL_ROOT:    '../',
        VERSION:     '2.7.8',
        COLLAPSE_INDEX: false,
        FILE_SUFFIX: '.html',
        HAS_SOURCE:  true
      };
    </script>
    <script type="text/javascript" src="../_static/jquery.js"></script>
    <script type="text/javascript" src="../_static/underscore.js"></script>
    <script type="text/javascript" src="../_static/doctools.js"></script>
    <script type="text/javascript" src="../_static/sidebar.js"></script>
    <link rel="search" type="application/opensearchdescription+xml"
          title="Search within Python v2.7.8 documentation"
          href="../_static/opensearch.xml"/>
    <link rel="author" title="About these documents" href="../about.html" />
    <link rel="copyright" title="Copyright" href="../copyright.html" />
    <link rel="top" title="Python v2.7.8 documentation" href="../index.html" />
    <link rel="up" title="8. Data Types" href="datatypes.html" />
    <link rel="next" title="8.15. types — Names for built-in types" href="types.html" />
    <link rel="prev" title="8.11. weakref — Weak references" href="weakref.html" />
    <link rel="shortcut icon" type="image/png" href="../_static/py.png" />
    <script type="text/javascript" src="../_static/copybutton.js"></script>
    
 
    

  </head>
  <body>  
    <div class="related">
      <h3>Navigation</h3>
      <ul>
        <li class="right" style="margin-right: 10px">
          <a href="../genindex.html" title="General Index"
             accesskey="I">index</a></li>
        <li class="right" >
          <a href="../py-modindex.html" title="Python Module Index"
             >modules</a> |</li>
        <li class="right" >
          <a href="types.html" title="8.15. types — Names for built-in types"
             accesskey="N">next</a> |</li>
        <li class="right" >
          <a href="weakref.html" title="8.11. weakref — Weak references"
             accesskey="P">previous</a> |</li>
        <li><img src="../_static/py.png" alt=""
                 style="vertical-align: middle; margin-top: -1px"/></li>
        <li><a href="http://www.python.org/">Python</a> &raquo;</li>
        <li>
          <a href="../index.html">Python v2.7.8 documentation</a> &raquo;
        </li>

          <li><a href="index.html" >The Python Standard Library</a> &raquo;</li>
          <li><a href="datatypes.html" accesskey="U">8. Data Types</a> &raquo;</li> 
      </ul>
    </div>    

    <div class="document">
      <div class="documentwrapper">
        <div class="bodywrapper">
          <div class="body">
            
  <div class="section" id="module-UserDict">
<span id="userdict-class-wrapper-for-dictionary-objects"></span><h1>8.12. <a class="reference internal" href="#module-UserDict" title="UserDict: Class wrapper for dictionary objects."><tt class="xref py py-mod docutils literal"><span class="pre">UserDict</span></tt></a> &#8212; Class wrapper for dictionary objects<a class="headerlink" href="#module-UserDict" title="Permalink to this headline">¶</a></h1>
<p><strong>Source code:</strong> <a class="reference external" href="http://hg.python.org/cpython/file/2.7/Lib/UserDict.py">Lib/UserDict.py</a></p>
<hr class="docutils" />
<p>The module defines a mixin,  <a class="reference internal" href="#UserDict.DictMixin" title="UserDict.DictMixin"><tt class="xref py py-class docutils literal"><span class="pre">DictMixin</span></tt></a>, defining all dictionary methods
for classes that already have a minimum mapping interface.  This greatly
simplifies writing classes that need to be substitutable for dictionaries (such
as the shelve module).</p>
<p>This module also defines a class, <a class="reference internal" href="#module-UserDict" title="UserDict: Class wrapper for dictionary objects."><tt class="xref py py-class docutils literal"><span class="pre">UserDict</span></tt></a>, that acts as a wrapper
around dictionary objects.  The need for this class has been largely supplanted
by the ability to subclass directly from <a class="reference internal" href="stdtypes.html#dict" title="dict"><tt class="xref py py-class docutils literal"><span class="pre">dict</span></tt></a> (a feature that became
available starting with Python version 2.2).  Prior to the introduction of
<a class="reference internal" href="stdtypes.html#dict" title="dict"><tt class="xref py py-class docutils literal"><span class="pre">dict</span></tt></a>, the <a class="reference internal" href="#module-UserDict" title="UserDict: Class wrapper for dictionary objects."><tt class="xref py py-class docutils literal"><span class="pre">UserDict</span></tt></a> class was used to create dictionary-like
sub-classes that obtained new behaviors by overriding existing methods or adding
new ones.</p>
<p>The <a class="reference internal" href="#module-UserDict" title="UserDict: Class wrapper for dictionary objects."><tt class="xref py py-mod docutils literal"><span class="pre">UserDict</span></tt></a> module defines the <a class="reference internal" href="#module-UserDict" title="UserDict: Class wrapper for dictionary objects."><tt class="xref py py-class docutils literal"><span class="pre">UserDict</span></tt></a> class and
<a class="reference internal" href="#UserDict.DictMixin" title="UserDict.DictMixin"><tt class="xref py py-class docutils literal"><span class="pre">DictMixin</span></tt></a>:</p>
<dl class="class">
<dt id="UserDict.UserDict">
<em class="property">class </em><tt class="descclassname">UserDict.</tt><tt class="descname">UserDict</tt><big>(</big><span class="optional">[</span><em>initialdata</em><span class="optional">]</span><big>)</big><a class="headerlink" href="#UserDict.UserDict" title="Permalink to this definition">¶</a></dt>
<dd><p>Class that simulates a dictionary.  The instance&#8217;s contents are kept in a
regular dictionary, which is accessible via the <tt class="xref py py-attr docutils literal"><span class="pre">data</span></tt> attribute of
<a class="reference internal" href="#module-UserDict" title="UserDict: Class wrapper for dictionary objects."><tt class="xref py py-class docutils literal"><span class="pre">UserDict</span></tt></a> instances.  If <em>initialdata</em> is provided, <tt class="xref py py-attr docutils literal"><span class="pre">data</span></tt> is
initialized with its contents; note that a reference to <em>initialdata</em> will not
be kept, allowing it be used for other purposes.</p>
<div class="admonition note">
<p class="first admonition-title">Note</p>
<p class="last">For backward compatibility, instances of <a class="reference internal" href="#module-UserDict" title="UserDict: Class wrapper for dictionary objects."><tt class="xref py py-class docutils literal"><span class="pre">UserDict</span></tt></a> are not iterable.</p>
</div>
</dd></dl>

<dl class="class">
<dt id="UserDict.IterableUserDict">
<em class="property">class </em><tt class="descclassname">UserDict.</tt><tt class="descname">IterableUserDict</tt><big>(</big><span class="optional">[</span><em>initialdata</em><span class="optional">]</span><big>)</big><a class="headerlink" href="#UserDict.IterableUserDict" title="Permalink to this definition">¶</a></dt>
<dd><p>Subclass of <a class="reference internal" href="#module-UserDict" title="UserDict: Class wrapper for dictionary objects."><tt class="xref py py-class docutils literal"><span class="pre">UserDict</span></tt></a> that supports direct iteration (e.g.  <tt class="docutils literal"><span class="pre">for</span> <span class="pre">key</span> <span class="pre">in</span>
<span class="pre">myDict</span></tt>).</p>
</dd></dl>

<p>In addition to supporting the methods and operations of mappings (see section
<a class="reference internal" href="stdtypes.html#typesmapping"><em>Mapping Types &#8212; dict</em></a>), <a class="reference internal" href="#module-UserDict" title="UserDict: Class wrapper for dictionary objects."><tt class="xref py py-class docutils literal"><span class="pre">UserDict</span></tt></a> and <a class="reference internal" href="#UserDict.IterableUserDict" title="UserDict.IterableUserDict"><tt class="xref py py-class docutils literal"><span class="pre">IterableUserDict</span></tt></a> instances
provide the following attribute:</p>
<dl class="attribute">
<dt id="UserDict.IterableUserDict.data">
<tt class="descclassname">IterableUserDict.</tt><tt class="descname">data</tt><a class="headerlink" href="#UserDict.IterableUserDict.data" title="Permalink to this definition">¶</a></dt>
<dd><p>A real dictionary used to store the contents of the <a class="reference internal" href="#module-UserDict" title="UserDict: Class wrapper for dictionary objects."><tt class="xref py py-class docutils literal"><span class="pre">UserDict</span></tt></a> class.</p>
</dd></dl>

<dl class="class">
<dt id="UserDict.DictMixin">
<em class="property">class </em><tt class="descclassname">UserDict.</tt><tt class="descname">DictMixin</tt><a class="headerlink" href="#UserDict.DictMixin" title="Permalink to this definition">¶</a></dt>
<dd><p>Mixin defining all dictionary methods for classes that already have a minimum
dictionary interface including <a class="reference internal" href="../reference/datamodel.html#object.__getitem__" title="object.__getitem__"><tt class="xref py py-meth docutils literal"><span class="pre">__getitem__()</span></tt></a>, <a class="reference internal" href="../reference/datamodel.html#object.__setitem__" title="object.__setitem__"><tt class="xref py py-meth docutils literal"><span class="pre">__setitem__()</span></tt></a>,
<a class="reference internal" href="../reference/datamodel.html#object.__delitem__" title="object.__delitem__"><tt class="xref py py-meth docutils literal"><span class="pre">__delitem__()</span></tt></a>, and <tt class="xref py py-meth docutils literal"><span class="pre">keys()</span></tt>.</p>
<p>This mixin should be used as a superclass.  Adding each of the above methods
adds progressively more functionality.  For instance, defining all but
<a class="reference internal" href="../reference/datamodel.html#object.__delitem__" title="object.__delitem__"><tt class="xref py py-meth docutils literal"><span class="pre">__delitem__()</span></tt></a> will preclude only <tt class="xref py py-meth docutils literal"><span class="pre">pop()</span></tt> and <tt class="xref py py-meth docutils literal"><span class="pre">popitem()</span></tt> from the
full interface.</p>
<p>In addition to the four base methods, progressively more efficiency comes with
defining <a class="reference internal" href="../reference/datamodel.html#object.__contains__" title="object.__contains__"><tt class="xref py py-meth docutils literal"><span class="pre">__contains__()</span></tt></a>, <a class="reference internal" href="../reference/datamodel.html#object.__iter__" title="object.__iter__"><tt class="xref py py-meth docutils literal"><span class="pre">__iter__()</span></tt></a>, and <tt class="xref py py-meth docutils literal"><span class="pre">iteritems()</span></tt>.</p>
<p>Since the mixin has no knowledge of the subclass constructor, it does not define
<a class="reference internal" href="../reference/datamodel.html#object.__init__" title="object.__init__"><tt class="xref py py-meth docutils literal"><span class="pre">__init__()</span></tt></a> or <a class="reference internal" href="copy.html#module-copy" title="copy: Shallow and deep copy operations."><tt class="xref py py-meth docutils literal"><span class="pre">copy()</span></tt></a>.</p>
<p>Starting with Python version 2.6, it is recommended to use
<a class="reference internal" href="collections.html#collections.MutableMapping" title="collections.MutableMapping"><tt class="xref py py-class docutils literal"><span class="pre">collections.MutableMapping</span></tt></a> instead of <a class="reference internal" href="#UserDict.DictMixin" title="UserDict.DictMixin"><tt class="xref py py-class docutils literal"><span class="pre">DictMixin</span></tt></a>.</p>
</dd></dl>

</div>
<div class="section" id="module-UserList">
<span id="userlist-class-wrapper-for-list-objects"></span><h1>8.13. <a class="reference internal" href="#module-UserList" title="UserList: Class wrapper for list objects."><tt class="xref py py-mod docutils literal"><span class="pre">UserList</span></tt></a> &#8212; Class wrapper for list objects<a class="headerlink" href="#module-UserList" title="Permalink to this headline">¶</a></h1>
<div class="admonition note">
<p class="first admonition-title">Note</p>
<p>When Python 2.2 was released, many of the use cases for this class were
subsumed by the ability to subclass <a class="reference internal" href="functions.html#list" title="list"><tt class="xref py py-class docutils literal"><span class="pre">list</span></tt></a> directly.  However, a
handful of use cases remain.</p>
<p>This module provides a list-interface around an underlying data store.  By
default, that data store is a <a class="reference internal" href="functions.html#list" title="list"><tt class="xref py py-class docutils literal"><span class="pre">list</span></tt></a>; however, it can be used to wrap
a list-like interface around other objects (such as persistent storage).</p>
<p class="last">In addition, this class can be mixed-in with built-in classes using multiple
inheritance.  This can sometimes be useful.  For example, you can inherit
from <a class="reference internal" href="#module-UserList" title="UserList: Class wrapper for list objects."><tt class="xref py py-class docutils literal"><span class="pre">UserList</span></tt></a> and <a class="reference internal" href="functions.html#str" title="str"><tt class="xref py py-class docutils literal"><span class="pre">str</span></tt></a> at the same time.  That would not be
possible with both a real <a class="reference internal" href="functions.html#list" title="list"><tt class="xref py py-class docutils literal"><span class="pre">list</span></tt></a> and a real <a class="reference internal" href="functions.html#str" title="str"><tt class="xref py py-class docutils literal"><span class="pre">str</span></tt></a>.</p>
</div>
<p>This module defines a class that acts as a wrapper around list objects.  It is a
useful base class for your own list-like classes, which can inherit from them
and override existing methods or add new ones.  In this way one can add new
behaviors to lists.</p>
<p>The <a class="reference internal" href="#module-UserList" title="UserList: Class wrapper for list objects."><tt class="xref py py-mod docutils literal"><span class="pre">UserList</span></tt></a> module defines the <a class="reference internal" href="#module-UserList" title="UserList: Class wrapper for list objects."><tt class="xref py py-class docutils literal"><span class="pre">UserList</span></tt></a> class:</p>
<dl class="class">
<dt id="UserList.UserList">
<em class="property">class </em><tt class="descclassname">UserList.</tt><tt class="descname">UserList</tt><big>(</big><span class="optional">[</span><em>list</em><span class="optional">]</span><big>)</big><a class="headerlink" href="#UserList.UserList" title="Permalink to this definition">¶</a></dt>
<dd><p>Class that simulates a list.  The instance&#8217;s contents are kept in a regular
list, which is accessible via the <a class="reference internal" href="#UserList.UserList.data" title="UserList.UserList.data"><tt class="xref py py-attr docutils literal"><span class="pre">data</span></tt></a> attribute of <a class="reference internal" href="#module-UserList" title="UserList: Class wrapper for list objects."><tt class="xref py py-class docutils literal"><span class="pre">UserList</span></tt></a>
instances.  The instance&#8217;s contents are initially set to a copy of <em>list</em>,
defaulting to the empty list <tt class="docutils literal"><span class="pre">[]</span></tt>.  <em>list</em> can be any iterable, e.g. a
real Python list or a <a class="reference internal" href="#module-UserList" title="UserList: Class wrapper for list objects."><tt class="xref py py-class docutils literal"><span class="pre">UserList</span></tt></a> object.</p>
<div class="admonition note">
<p class="first admonition-title">Note</p>
<p class="last">The <a class="reference internal" href="#module-UserList" title="UserList: Class wrapper for list objects."><tt class="xref py py-class docutils literal"><span class="pre">UserList</span></tt></a> class has been moved to the <a class="reference internal" href="collections.html#module-collections" title="collections: High-performance datatypes"><tt class="xref py py-mod docutils literal"><span class="pre">collections</span></tt></a>
module in Python 3. The <a class="reference internal" href="../glossary.html#term-to3"><em class="xref std std-term">2to3</em></a> tool will automatically adapt
imports when converting your sources to Python 3.</p>
</div>
</dd></dl>

<p>In addition to supporting the methods and operations of mutable sequences (see
section <a class="reference internal" href="stdtypes.html#typesseq"><em>Sequence Types &#8212; str, unicode, list, tuple, bytearray, buffer, xrange</em></a>), <a class="reference internal" href="#module-UserList" title="UserList: Class wrapper for list objects."><tt class="xref py py-class docutils literal"><span class="pre">UserList</span></tt></a> instances provide the following
attribute:</p>
<dl class="attribute">
<dt id="UserList.UserList.data">
<tt class="descclassname">UserList.</tt><tt class="descname">data</tt><a class="headerlink" href="#UserList.UserList.data" title="Permalink to this definition">¶</a></dt>
<dd><p>A real Python list object used to store the contents of the <a class="reference internal" href="#module-UserList" title="UserList: Class wrapper for list objects."><tt class="xref py py-class docutils literal"><span class="pre">UserList</span></tt></a>
class.</p>
</dd></dl>

<p><strong>Subclassing requirements:</strong> Subclasses of <a class="reference internal" href="#module-UserList" title="UserList: Class wrapper for list objects."><tt class="xref py py-class docutils literal"><span class="pre">UserList</span></tt></a> are expected to
offer a constructor which can be called with either no arguments or one
argument.  List operations which return a new sequence attempt to create an
instance of the actual implementation class.  To do so, it assumes that the
constructor can be called with a single parameter, which is a sequence object
used as a data source.</p>
<p>If a derived class does not wish to comply with this requirement, all of the
special methods supported by this class will need to be overridden; please
consult the sources for information about the methods which need to be provided
in that case.</p>
<p class="versionchanged">
<span class="versionmodified">Changed in version 2.0: </span>Python versions 1.5.2 and 1.6 also required that the constructor be callable
with no parameters, and offer a mutable <tt class="xref py py-attr docutils literal"><span class="pre">data</span></tt> attribute.  Earlier
versions of Python did not attempt to create instances of the derived class.</p>
</div>
<div class="section" id="module-UserString">
<span id="userstring-class-wrapper-for-string-objects"></span><h1>8.14. <a class="reference internal" href="#module-UserString" title="UserString: Class wrapper for string objects."><tt class="xref py py-mod docutils literal"><span class="pre">UserString</span></tt></a> &#8212; Class wrapper for string objects<a class="headerlink" href="#module-UserString" title="Permalink to this headline">¶</a></h1>
<div class="admonition note">
<p class="first admonition-title">Note</p>
<p class="last">This <a class="reference internal" href="#module-UserString" title="UserString: Class wrapper for string objects."><tt class="xref py py-class docutils literal"><span class="pre">UserString</span></tt></a> class from this module is available for backward
compatibility only.  If you are writing code that does not need to work with
versions of Python earlier than Python 2.2, please consider subclassing directly
from the built-in <a class="reference internal" href="functions.html#str" title="str"><tt class="xref py py-class docutils literal"><span class="pre">str</span></tt></a> type instead of using <a class="reference internal" href="#module-UserString" title="UserString: Class wrapper for string objects."><tt class="xref py py-class docutils literal"><span class="pre">UserString</span></tt></a> (there
is no built-in equivalent to <a class="reference internal" href="#UserString.MutableString" title="UserString.MutableString"><tt class="xref py py-class docutils literal"><span class="pre">MutableString</span></tt></a>).</p>
</div>
<p>This module defines a class that acts as a wrapper around string objects.  It is
a useful base class for your own string-like classes, which can inherit from
them and override existing methods or add new ones.  In this way one can add new
behaviors to strings.</p>
<p>It should be noted that these classes are highly inefficient compared to real
string or Unicode objects; this is especially the case for
<a class="reference internal" href="#UserString.MutableString" title="UserString.MutableString"><tt class="xref py py-class docutils literal"><span class="pre">MutableString</span></tt></a>.</p>
<p>The <a class="reference internal" href="#module-UserString" title="UserString: Class wrapper for string objects."><tt class="xref py py-mod docutils literal"><span class="pre">UserString</span></tt></a> module defines the following classes:</p>
<dl class="class">
<dt id="UserString.UserString">
<em class="property">class </em><tt class="descclassname">UserString.</tt><tt class="descname">UserString</tt><big>(</big><span class="optional">[</span><em>sequence</em><span class="optional">]</span><big>)</big><a class="headerlink" href="#UserString.UserString" title="Permalink to this definition">¶</a></dt>
<dd><p>Class that simulates a string or a Unicode string object.  The instance&#8217;s
content is kept in a regular string or Unicode string object, which is
accessible via the <tt class="xref py py-attr docutils literal"><span class="pre">data</span></tt> attribute of <a class="reference internal" href="#module-UserString" title="UserString: Class wrapper for string objects."><tt class="xref py py-class docutils literal"><span class="pre">UserString</span></tt></a> instances.  The
instance&#8217;s contents are initially set to a copy of <em>sequence</em>.  <em>sequence</em> can
be either a regular Python string or Unicode string, an instance of
<a class="reference internal" href="#module-UserString" title="UserString: Class wrapper for string objects."><tt class="xref py py-class docutils literal"><span class="pre">UserString</span></tt></a> (or a subclass) or an arbitrary sequence which can be
converted into a string using the built-in <a class="reference internal" href="functions.html#str" title="str"><tt class="xref py py-func docutils literal"><span class="pre">str()</span></tt></a> function.</p>
<div class="admonition note">
<p class="first admonition-title">Note</p>
<p class="last">The <a class="reference internal" href="#module-UserString" title="UserString: Class wrapper for string objects."><tt class="xref py py-class docutils literal"><span class="pre">UserString</span></tt></a> class has been moved to the <a class="reference internal" href="collections.html#module-collections" title="collections: High-performance datatypes"><tt class="xref py py-mod docutils literal"><span class="pre">collections</span></tt></a>
module in Python 3. The <a class="reference internal" href="../glossary.html#term-to3"><em class="xref std std-term">2to3</em></a> tool will automatically adapt
imports when converting your sources to Python 3.</p>
</div>
</dd></dl>

<dl class="class">
<dt id="UserString.MutableString">
<em class="property">class </em><tt class="descclassname">UserString.</tt><tt class="descname">MutableString</tt><big>(</big><span class="optional">[</span><em>sequence</em><span class="optional">]</span><big>)</big><a class="headerlink" href="#UserString.MutableString" title="Permalink to this definition">¶</a></dt>
<dd><p>This class is derived from the <a class="reference internal" href="#module-UserString" title="UserString: Class wrapper for string objects."><tt class="xref py py-class docutils literal"><span class="pre">UserString</span></tt></a> above and redefines strings
to be <em>mutable</em>.  Mutable strings can&#8217;t be used as dictionary keys, because
dictionaries require <em>immutable</em> objects as keys.  The main intention of this
class is to serve as an educational example for inheritance and necessity to
remove (override) the <a class="reference internal" href="../reference/datamodel.html#object.__hash__" title="object.__hash__"><tt class="xref py py-meth docutils literal"><span class="pre">__hash__()</span></tt></a> method in order to trap attempts to use a
mutable object as dictionary key, which would be otherwise very error prone and
hard to track down.</p>
<p class="deprecated">
<span class="versionmodified">Deprecated since version 2.6: </span>The <a class="reference internal" href="#UserString.MutableString" title="UserString.MutableString"><tt class="xref py py-class docutils literal"><span class="pre">MutableString</span></tt></a> class has been removed in Python 3.</p>
</dd></dl>

<p>In addition to supporting the methods and operations of string and Unicode
objects (see section <a class="reference internal" href="stdtypes.html#string-methods"><em>String Methods</em></a>), <a class="reference internal" href="#module-UserString" title="UserString: Class wrapper for string objects."><tt class="xref py py-class docutils literal"><span class="pre">UserString</span></tt></a> instances
provide the following attribute:</p>
<dl class="attribute">
<dt id="UserString.MutableString.data">
<tt class="descclassname">MutableString.</tt><tt class="descname">data</tt><a class="headerlink" href="#UserString.MutableString.data" title="Permalink to this definition">¶</a></dt>
<dd><p>A real Python string or Unicode object used to store the content of the
<a class="reference internal" href="#module-UserString" title="UserString: Class wrapper for string objects."><tt class="xref py py-class docutils literal"><span class="pre">UserString</span></tt></a> class.</p>
</dd></dl>

</div>


          </div>
        </div>
      </div>
      <div class="sphinxsidebar">
        <div class="sphinxsidebarwrapper">
  <h3><a href="../contents.html">Table Of Contents</a></h3>
  <ul>
<li><a class="reference internal" href="#">8.12. <tt class="docutils literal"><span class="pre">UserDict</span></tt> &#8212; Class wrapper for dictionary objects</a></li>
<li><a class="reference internal" href="#module-UserList">8.13. <tt class="docutils literal"><span class="pre">UserList</span></tt> &#8212; Class wrapper for list objects</a></li>
<li><a class="reference internal" href="#module-UserString">8.14. <tt class="docutils literal"><span class="pre">UserString</span></tt> &#8212; Class wrapper for string objects</a></li>
</ul>

  <h4>Previous topic</h4>
  <p class="topless"><a href="weakref.html"
                        title="previous chapter">8.11. <tt class="docutils literal docutils literal"><span class="pre">weakref</span></tt> &#8212; Weak references</a></p>
  <h4>Next topic</h4>
  <p class="topless"><a href="types.html"
                        title="next chapter">8.15. <tt class="docutils literal docutils literal docutils literal"><span class="pre">types</span></tt> &#8212; Names for built-in types</a></p>
<h3>This Page</h3>
<ul class="this-page-menu">
  <li><a href="../bugs.html">Report a Bug</a></li>
  <li><a href="../_sources/library/userdict.txt"
         rel="nofollow">Show Source</a></li>
</ul>

<div id="searchbox" style="display: none">
  <h3>Quick search</h3>
    <form class="search" action="../search.html" method="get">
      <input type="text" name="q" size="18" />
      <input type="submit" value="Go" />
      <input type="hidden" name="check_keywords" value="yes" />
      <input type="hidden" name="area" value="default" />
    </form>
    <p class="searchtip" style="font-size: 90%">
    Enter search terms or a module, class or function name.
    </p>
</div>
<script type="text/javascript">$('#searchbox').show(0);</script>
        </div>
      </div>
      <div class="clearer"></div>
    </div>  
    <div class="related">
      <h3>Navigation</h3>
      <ul>
        <li class="right" style="margin-right: 10px">
          <a href="../genindex.html" title="General Index"
             >index</a></li>
        <li class="right" >
          <a href="../py-modindex.html" title="Python Module Index"
             >modules</a> |</li>
        <li class="right" >
          <a href="types.html" title="8.15. types — Names for built-in types"
             >next</a> |</li>
        <li class="right" >
          <a href="weakref.html" title="8.11. weakref — Weak references"
             >previous</a> |</li>
        <li><img src="../_static/py.png" alt=""
                 style="vertical-align: middle; margin-top: -1px"/></li>
        <li><a href="http://www.python.org/">Python</a> &raquo;</li>
        <li>
          <a href="../index.html">Python v2.7.8 documentation</a> &raquo;
        </li>

          <li><a href="index.html" >The Python Standard Library</a> &raquo;</li>
          <li><a href="datatypes.html" >8. Data Types</a> &raquo;</li> 
      </ul>
    </div>  
    <div class="footer">
    &copy; <a href="../copyright.html">Copyright</a> 1990-2014, Python Software Foundation.
    <br />
    The Python Software Foundation is a non-profit corporation.
    <a href="http://www.python.org/psf/donations/">Please donate.</a>
    <br />
    Last updated on Jun 29, 2014.
    <a href="../bugs.html">Found a bug</a>?
    <br />
    Created using <a href="http://sphinx.pocoo.org/">Sphinx</a> 1.0.7.
    </div>

  </body>
</html>